OptionElement

public interface OptionElement implements Element

An HTML DOM option element.

Provides access to the attributes of the option element.

Properties

Link copied to clipboard

Returns HTML attributes of this element.

Link copied to clipboard
public final String innerHtml
public final String innerHtml

Returns a string with the HTML content of this element, or an empty string if the element does not have inner HTML.

Link copied to clipboard
public final String innerText
public final String innerText

Returns a string with the content of the element and its descendants, or an empty string if this element does not have a content.

Link copied to clipboard
public final Node nextSibling
public final Node nextSibling

Returns the next node in the document tree, if any.

Link copied to clipboard
public final String outerHtml
public final String outerHtml

Returns a string with the HTML serialization of this element and its descendants.

Link copied to clipboard
public final Node parent
public final Node parent

Returns the parent of this node, if any.

Link copied to clipboard
public final Node previousSibling
public final Node previousSibling

Returns the previous node in the document tree, if any.

Link copied to clipboard
public final XPathExpression xPath
public final XPathExpression xPath

Returns XPathExpression that represents path to this Node, or an empty expression if it is not available.

Functions

Link copied to clipboard
public abstract void addEventListener(EventType eventType, Observer<Event> listener, boolean useCapture)
Adds the given listener to the event target.
Link copied to clipboard
public abstract boolean appendChild(Node childNode)
Adds the given node as a child of the current node to the end of its children list.
Link copied to clipboard
public abstract ElementAttributes attributes()
Returns HTML attributes of this element.
Link copied to clipboard
public abstract void blur()
Removes keyboard focus from the current element.
Link copied to clipboard
public abstract Rect boundingClientRect()
Returns the rectangle bounds of the element and its position relative to the top-left of the viewport of the current document.
Link copied to clipboard
public abstract List<Node> children()
Returns an immutable list of all children of this node.
Link copied to clipboard
public abstract void click()
Simulates a click on the node.
Link copied to clipboard
public abstract void close()
Closes this node.
Link copied to clipboard
public abstract Set<DocumentPosition> compareDocumentPosition(Node otherNode)
Compares position of the current node against another node in a DOM tree.
Link copied to clipboard
public abstract boolean dispatch(Event event)
Dispatches the given event at the current event target.
Link copied to clipboard
public abstract Document document()
Returns the Document instance of this node.
Link copied to clipboard
public abstract XPathResult evaluate(String expression)
Evaluates the given XPath expression for the node and returns the XPathResult of the ANY type.
public abstract XPathResult evaluate(String expression, XPathResultType type)
Evaluates the given XPath expression for the node and returns the XPathResult object of the given type.
Link copied to clipboard
public final XPathResult evaluate(XPathExpression expression)
public final XPathResult evaluate(XPathExpression expression)

Evaluates the given expression for the node and returns XPathResult of the XPathResultType.ANY type.

public final XPathResult evaluate(XPathExpression expression, XPathResultType type)
public final XPathResult evaluate(XPathExpression expression, XPathResultType type)

Evaluates the given expression for the node and returns XPathResult of the given type.

Link copied to clipboard
public abstract List<Observer<Event>> eventListeners(EventType eventType, boolean useCapture)
Returns the immutable list of event listeners that listen events of the given eventType in a phase that corresponds the given useCapture.
Link copied to clipboard
public final Element findByClassName(String className)
public final Element findByClassName(String className)

Returns the first Element found in the current search context by the given className, if any.

Link copied to clipboard
public final Element findByCssSelector(String cssSelector)
public final Element findByCssSelector(String cssSelector)

Returns the first Element found in the current search context by the given cssSelector, if any.

Link copied to clipboard
public final Element findById(String id)
public final Element findById(String id)

Returns the first Element found in the current search context by the given id, if any.

Link copied to clipboard
public final Element findByName(String name)
public final Element findByName(String name)

Returns the first Element found in the current search context by the given name, if any.

Link copied to clipboard
public final Element findByTagName(String tagName)
public final Element findByTagName(String tagName)

Returns the first Element found in the current search context by the given tagName, if any.

Link copied to clipboard
public abstract Optional<Element> findElementByClassName(String className)
Returns the first Element object found in the current search context by the given className.
Link copied to clipboard
public abstract Optional<Element> findElementByCssSelector(String cssSelector)
Returns the first Element object found in the current search context by the given cssSelector.
Link copied to clipboard
public abstract Optional<Element> findElementById(String id)
Returns the first Element object found in the current search context by the given id.
Link copied to clipboard
public abstract Optional<Element> findElementByName(String name)
Returns the first Element object found in the current search context by the given name.
Link copied to clipboard
public abstract Optional<Element> findElementByTagName(String tagName)
Returns the first Element object found in the current search context by the given tagName.
Link copied to clipboard
public abstract List<Element> findElementsByClassName(String className)
Returns an immutable list of the Element objects found in the current search context by the given className.
Link copied to clipboard
public abstract List<Element> findElementsByCssSelector(String cssSelector)
Returns an immutable list of the Element objects found in the current search context by the given cssSelector.
Link copied to clipboard
public abstract List<Element> findElementsById(String id)
Returns an immutable list of the Element objects found in the current search context by the given id.
Link copied to clipboard
public abstract List<Element> findElementsByName(String name)
Returns an immutable list of the Element objects found in the current search context by the given name.
Link copied to clipboard
public abstract List<Element> findElementsByTagName(String tagName)
Returns an immutable list of the Element objects found in the current search context by the given tagName.
Link copied to clipboard
public abstract void focus()
Sets focus on this element, if it can be focused.
Link copied to clipboard
public final Element getByClassName(String className)
public final Element getByClassName(String className)

Returns the first Element found in the current search context by the given className.

Link copied to clipboard
public final Element getByCssSelector(String cssSelector)
public final Element getByCssSelector(String cssSelector)

Returns the first Element found in the current search context by the given cssSelector.

Link copied to clipboard
public final Element getById(String id)
public final Element getById(String id)

Returns the first Element found in the current search context by the given id.

Link copied to clipboard
public final Element getByName(String name)
public final Element getByName(String name)

Returns the first Element found in the current search context by the given name.

Link copied to clipboard
public final Element getByTagName(String tagName)
public final Element getByTagName(String tagName)

Returns the first Element found in the current search context by the given tagName.

Link copied to clipboard
public abstract String innerHtml()
Returns a string with the HTML content of this element, or an empty string if the element does not have inner HTML.
public abstract boolean innerHtml(String html)
Replaces the HTML content of this element with the given html.
Link copied to clipboard
public abstract String innerText()
Returns a string with the text content of the element and its descendants.
public abstract boolean innerText(String innerText)
Replaces the text content of the element with the given innerText value.
Link copied to clipboard
public abstract boolean insertChild(Node node, Node beforeNode)
Inserts the given node before the given beforeNode as a child of the current node.
Link copied to clipboard
public abstract boolean isSelected()
Returns true if the current option element is selected.
Link copied to clipboard
public abstract Optional<Node> nextSibling()
Returns an Optional that contains the next node in the document tree if such a node exists, otherwise returns an empty Optional.
Link copied to clipboard
public abstract String nodeName()
Returns a string that represents the node name in the UTF8 format.
Link copied to clipboard
public abstract String nodeValue()
Returns a string that represents the node value.
public abstract void nodeValue(String value)
Updates the node value with the given new value.
Link copied to clipboard
public abstract String outerHtml()
Returns a string with the HTML serialization of this element and its descendants.
public abstract boolean outerHtml(String html)
Replaces the element and all of its descendants with a new DOM tree constructed by parsing the given html.
Link copied to clipboard
public abstract Optional<Node> parent()
Returns an Optional that contains the parent of this node.
Link copied to clipboard
public abstract Optional<Node> previousSibling()
Returns an Optional that contains the previous node in the document tree if such a node exists, otherwise returns an empty Optional.
Link copied to clipboard
public abstract boolean removeChild(Node childNode)
Removes the given childNode of the current node from the DOM.
Link copied to clipboard
public abstract void removeEventListener(EventType eventType, Observer<Event> listener, boolean useCapture)
Removes the given listener from the event target.
Link copied to clipboard
public abstract boolean replaceChild(Node newNode, Node oldNode)
Replaces the given child oldNode of the current node with the given newNode.
Link copied to clipboard
public abstract void scrollIntoView(Element.AlignTo alignTo)
Scrolls the element's parent container such that the element on which this method is called is visible to the user.
Link copied to clipboard
public abstract void select()
Selects the current option element.
Link copied to clipboard
public abstract String textContent()
Returns the text content of the current node and its descendants.
public abstract void textContent(String textContent)
Removes all the current node children and replaces them with a single text node with the given textContent.
Link copied to clipboard
public abstract NodeType type()
Returns the node type.
Link copied to clipboard
public abstract void unselect()
Un-selects the current option element.
Link copied to clipboard
public abstract String xPath()
Returns a string that represents XPath to the current Node or an empty string if it is not available.